﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public delegate void ddlQuestiontype_SelectedIndexChanged(object sender, EventArgs e);
public delegate void imgbtnAddNewAnswer_Click(object sender, ImageClickEventArgs e);
public delegate void btnSessionQuestion_Click(object sender, EventArgs e);
namespace SuperSurvey.UserControl
{
    public partial class AddQuestion : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        // khai bao cac properties cua usercontrol: addquestion
        public TextBox QuestionTitle {
            get { return txtQuestionTitle; }
            set { txtQuestionTitle = value; }
        }
        public DropDownList QuestionType {
            get { return ddlQuestiontype; }
            set { ddlQuestiontype = value; }
        }
        public MultiView MultiViewAnswer {
            get { return mvwAnswerType; }
            set { mvwAnswerType = value; }
        }
        public View ViewTextBox {
            get { return vwTextAnswer; }
            set { vwTextAnswer= value;}
        }
        public View ViewRadioAnswer {
            get { return vwRadioAnswer; }
            set { vwRadioAnswer = value; }
        }
        public View ViewCheckboxAnswer {
            get { return vwCheckboxAnswers; }
            set { vwCheckboxAnswers = value; }
        }
        public event ddlQuestiontype_SelectedIndexChanged ddlQuetionTypeSelectedIndexChanged;
        protected virtual void DdlQuestionTypeChanged( EventArgs e) {
            if (ddlQuetionTypeSelectedIndexChanged != null)
            {
                ddlQuetionTypeSelectedIndexChanged(this, e);
            }
            
        }

        protected void ddlQuestiontype_SelectedIndexChanged(object sender, EventArgs e)
        {
            DdlQuestionTypeChanged(e);
        }

        public Panel PanelCheckBoxAnswer {
            get { return pnlCheckAnsewers; }
            set { pnlCheckAnsewers = value; }
        }
        public Panel PanelRadioAnswer {
            get { return pnlRadioAnsewers; }
            set { pnlRadioAnsewers = value; }
        }
        public Panel PanelTextBox {
            get { return pnlTextAnswer; }
            set { pnlTextAnswer = value; }
        }

        public ImageButton ImageButtonAddNewItem {
            get { return imgbtnAddNewAnswer; }
            set { imgbtnAddNewAnswer = value; }
        }

        public event imgbtnAddNewAnswer_Click OnimgbtnAddNewAnswerclk;
        protected virtual void ImgbtnAddNewAnswerClick(ImageClickEventArgs e) {
            if (OnimgbtnAddNewAnswerclk != null)
            {
                OnimgbtnAddNewAnswerclk(this, e);
            }
            
        }
        protected void imgbtnAddNewAnswer_Click(object sender, ImageClickEventArgs e)
        {
            ImgbtnAddNewAnswerClick(e);
        }
        public Label LabelQuestionNumber {
            get { return lblQuestionNumber; }
            set { lblQuestionNumber = value; }
        }
        public TextBox NumberAnswer {
            get { return txtNumberAnswer; }
            set { txtNumberAnswer = value; }
        }
        public Button savesessionquestion
        {
            get { return btnSessionQuestion; }
            set { btnSessionQuestion = value; }
        }
        public event btnSessionQuestion_Click onbtnsavesessionquestionclick;
        protected virtual void btnsavesessionquestion(EventArgs e)
        {
            if (onbtnsavesessionquestionclick != null)
            {
                onbtnsavesessionquestionclick(this, e);
            }
        }

        protected void btnSessionQuestion_Click(object sender, EventArgs e)
        {
            btnsavesessionquestion(e);
        }

       
    }
}